#include <iostream>
#include <string>

using namespace std;

struct student {
    int id;
    string name;
    int age;
};

/**
 * 利用指针访问结构体成员
 */
int main() {
    struct student s1 = {1, "Tom", 18};

    struct student *p = &s1;

    cout << "id: " << p->id << endl;
    cout << "name: " << p->name << endl;
    cout << "age: " << p->age << endl;

    return 0;
}